import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue';
import router from './router';
import store from './store';
import axios from 'axios';
import qs from 'qs';
import * as filters from './utils/filters';
import wxApi from './utils/wxApi';
import wxShare from './utils/wxShare';
import * as utils from './utils/util';
import 'lib-flexible';
import { debounce } from './utils/directive-vue';
import { sensorsSend } from './utils/sa-sdk';
import registryToast from './components/toast/init';
Vue.directive('debounce', debounce);

import Vconsole from 'vconsole';

const vConsole = new Vconsole();
// if (process.env.NODE_ENV != 'prd') {
//     const vConsole = new Vconsole();
// }

import VueClipboard from 'vue-clipboard2';
Vue.use(VueClipboard);

import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts;

Vue.use(ElementUI);
Vue.use(registryToast);
Vue.config.productionTip = false;
Vue.prototype.$axios = axios;
Vue.prototype.qs = qs;
Vue.prototype.$wxApi = wxApi;
Vue.prototype.$utils = utils;
Vue.prototype.$wxShare = wxShare;
Vue.prototype.$defaultAvatar = `${utils.apiUrl}/mfs/default_avatar.png`;
Vue.prototype.$wxOpenId = '';

// 获取企业微信appId
Vue.prototype.APPID = process.env.VUE_APP_AppId;
Vue.prototype.$sensorsSend = sensorsSend;

Object.keys(filters).forEach((key) => {
    Vue.filter(key, filters[key]);
});

Vue.config.ignoredElements = ['wx-open-launch-weapp', 'wx-open-launch-app'];
new Vue({
    el: '#app',
    router,
    store,
    render: (h) => h(App)
}).$mount('#app');
